import java.util.ArrayList;
class Student {
    public String name;
    public int age;
    public double fraction;

    public double getFraction() {
        return fraction;
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }
    public Student(int age,String name,double fraction){
        this.name=name;
        this.age=age;
        this.fraction=fraction;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", fraction=" + fraction +
                '}';
    }
}

public class Test {
    public static void main(String[] args) {
        ArrayList<Student>arrayList1=new ArrayList<>();
        arrayList1.add(new Student(18,"张三",123.2));
        arrayList1.add(new Student(18,"张思",124.8));
        arrayList1.add(new Student(18,"小王",128.3));
        for (Student s:arrayList1
             ) {
            System.out.println(s);
        }
    }
}
